<?php

/*
	* @author Nguyen Xuan Hong
	* @copyright 2011
	*/
							
	require_once('../includes/pageconfig.tbl.php');

	$pageconfig = new clsPageConfigTable();
	//$pageconfig->reloadocunter();
	//$subpageconfig->unUserAttr(array("username"));
	
	if($_GET['mode'] == 'page')
	{		// Page config mode
		// Redefine insert
		$pageconfig->useattr('title,banner_pic,banner_flash,intro');
		$pageconfig->loadDB();
		if($pageconfig->avaibleSubmit())
		{
			$pageconfig->loadBuffer();
			
			$banner_pic = upload_file("Images/", 'imgbrowser_banner_pic', $pageconfig->value('banner_pic'));
			if($banner_pic != "")
			{
				$pageconfig->setvalue('banner_pic', $banner_pic);
			}
			
			$banner_flash = upload_file("Images/", 'videobrowser_banner_flash', $pageconfig->value('banner_flash'));
			if($banner_flash != "")
			{
				$pageconfig->setvalue('banner_flash', $banner_flash);
			}
			
			$pageconfig->updateDB();
			echo acpredirect();
			exit();
		}
		echo $pageconfig->createForm('Thay đổi thông tin website');
		exit();
	}
?> 














  